<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return redirect('home/index');
});

// 后台
// 主页
Route::get('/admin/index', 'Admin\IndexController@index');

// 用户管理
Route::get('/admin/user/add', 'Admin\UserController@add');
Route::post('/admin/user/insert', 'Admin\UserController@insert');
Route::get('/admin/user/index', 'Admin\UserController@index');

//ajax修改用户名
Route::get('/admin/user/changename','Admin\UserController@changeName');
//修改状态
Route::get('/admin/user/changeairline','Admin\UserController@changeAirline');
Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
Route::post('/admin/user/update','Admin\UserController@update');


Route::get('/admin/user/delete/{id}','Admin\UserController@delete');

// 分类管理
Route::resource('/admin/category', 'Admin\CategoryController');

// 后台登陆
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/login','Admin\LoginController@login');
Route::get('/admin/logout','Admin\LoginController@logout');

// 验证码
Route::get('/admin/code/{random?}', 'Admin\CodeController@code');

// 忘记密码
Route::get('/admin/reset/forget', 'Admin\ResetController@forget');
Route::post('/admin/reset/send', 'Admin\ResetController@send');
Route::get('/admin/reset/find/{token}', 'Admin\ResetController@find');
Route::get('/admin/reset/info', 'Admin\ResetController@info');
Route::post('/admin/reset/uppass', 'Admin\ResetController@uppass');


//添加商品
Route::get('/admin/goods/add','Admin\GoodsController@add');
Route::post('/admin/goods/doadd','Admin\GoodsController@doadd');
Route::get('/admin/goods/index','Admin\GoodsController@index');
Route::get('/admin/goods/changegstatus','Admin\GoodsController@changegstatus');
Route::get('/admin/goods/changegname','Admin\GoodsController@changegname');

//删除商品
Route::get('/admin/goods/delete/{id}','Admin\GoodsController@delete');

//编辑商品
Route::get('admin/goods/edit/{id}','Admin\GoodsController@edit');
Route::post('admin/goods/update','Admin\GoodsController@update');


//商品详情
Route::post('admin/goods/index_info','Admin\GoodsController@index_info');
Route::get('admin/goods/add_info/','Admin\GoodsController@add_info');
Route::get('admin/goods/goodsDoinfo/{id}','Admin\GoodsController@goodsDoinfo');
Route::get('admin/goods/goodsEditinfo/{id}','Admin\GoodsController@goodsEditinfo');
Route::post('admin/goods/goodsupdate','Admin\GoodsController@goodsupdate');

//商品评论
Route::get('admin/goods/deletecom','Admin\GoodsController@deletecom');
Route::get('admin/goods/deleteoop/{id}','Admin\GoodsController@deleteoop');

//主打商品
Route::get('admin/goodszhuda/add/{id}','Admin\GoodsZhudaController@add');
Route::post('admin/goodszhuda/doadd/','Admin\GoodsZhudaController@doadd');
Route::get('admin/goodszhuda/index','Admin\GoodsZhudaController@index');
Route::get('admin/goodszhuda/edit','Admin\GoodsZhudaController@index');
Route::get('admin/goodszhuda/ajax','Admin\GoodsZhudaController@ajax');
Route::get('admin/goodszhuda/deletezhuda/{id}','Admin\GoodsZhudaController@deletezhuda');


// 购物车
Route::get('/admin/cart/index', 'Admin\CartController@index');
Route::get('/admin/cart/insert', 'Admin\CartController@insert');


// 订单管理
Route::get('/admin/order/index', 'Admin\OrderController@index');
Route::get('/admin/order/detail/{id}', 'Admin\OrderController@detail');
Route::post('admin/order/update','Admin\OrderController@update');
Route::get('/admin/order/delete/{id}','Admin\OrderController@delete');
Route::get('/admin/order/send/{id}','Admin\OrderController@send');

// 留言
Route::get('/admin/forum/add','Admin\ForumController@add');
Route::post('/admin/forum/insert','Admin\ForumController@insert');
Route::get('/admin/forum/index','Admin\ForumController@index');
Route::get('/admin/forum/edit/{id}','Admin\ForumController@edit');
Route::post('/admin/forum/update','Admin\ForumController@update');
Route::get('/admin/forum/delete/{id}','Admin\ForumController@delete');
Route::get('/admin/forum/pldel/{id}','Admin\ForumController@pldel');
Route::get('/admin/forum/detail/{id}','Admin\ForumController@detail');
//加入我们
Route::post('admin/joinme/add','Admin\JoinmeController@add');
Route::get('admin/joinme/index','Admin\JoinmeController@index');
Route::get('admin/joinme/delete/{id}','Admin\JoinmeController@delete');
//关于我们
Route::get('/admin/Notice/add','Admin\NoticeController@add');
Route::get('/admin/Notice/index','Admin\NoticeController@index');
Route::post('/admin/Notice/doadd','Admin\NoticeController@doadd');
Route::get('/admin/Notice/delete/{id}','Admin\NoticeController@delete');
Route::get('/admin/Notice/edit/{id}','Admin\NoticeController@edit');
Route::post('/admin/Notice/update','Admin\NoticeController@update');

//友情链接
Route::get('/admin/lianjie/add','Admin\LianjieController@add');
Route::get('/admin/lianjie/index','Admin\LianjieController@index');
Route::post('/admin/lianjie/doadd','Admin\LianjieController@doadd');
Route::get('/admin/lianjie/edit/{id}','Admin\LianjieController@edit');
Route::get('/admin/lianjie/delete/{id}','Admin\LianjieController@delete');
Route::post('/admin/lianjie/update','Admin\LianjieController@update');




// 前台
// 主页
Route::get('/home/index','Home\IndexController@index');

//关于我们
Route::get('/home/notice/index','Home\NoticeController@index');
Route::get('/home/notice/lianjie/{id}','Home\NoticeController@lianjie');


//改变前台轮廓图 和广告位置
Route::get('/admin/rollimg/add','Admin\RollimgController@add');
Route::post('/admin/rollimg/insert','Admin\RollimgController@insert');
Route::get('/admin/rollimg/index','Admin\RollimgController@index');
Route::get('/admin/rollimg/edit/{id}','Admin\RollimgController@edit');
Route::post('/admin/rollimg/update','Admin\RollimgController@update');
Route::get('/admin/rollimg/delete/{id}','Admin\RollimgController@delete');
Route::get('/admin/change/itv','Admin\ChangeController@itvadd');
Route::post('/admin/change/insert','Admin\ChangeController@insert');
Route::get('/admin/change/itvindex','Admin\ChangeController@index');
Route::get('/admin/change/itvedit/{id}','Admin\ChangeController@edit');
Route::post('/admin/change/itvupdate','Admin\ChangeController@update');
Route::get('/admin/change/itvdelete/{id}','Admin\ChangeController@delete');
Route::get('/admin/change/itvname','Admin\ChangeController@itvName');

//商品list
Route::get('home/goods/index/{id}','Home\GoodsController@index');
Route::get('home/goods/detail/{id}','Home\GoodsController@detail');
Route::get('home/goods/select','Home\GoodsController@select');
Route::get('home/goods/comment/{oid}/{gid}','Home\GoodsController@comment');
Route::post('home/goods/comtext','Home\GoodsController@comtext');
Route::get('home/goods/shoucang/{id}','Home\GoodsController@shoucang');

// 购物车
Route::get('home/cart/add/{id}','Home\CartController@add');
Route::get('home/cart/index','Home\CartController@index');

Route::get('home/cart/ajaxjia','Home\CartController@ajaxjia');
Route::get('home/cart/ajaxjian','Home\CartController@ajaxjian');
Route::get('home/cart/del/{id}','Home\CartController@del');
Route::get('home/cart/delete','Home\CartController@delete');


// 订单
Route::get('home/order/add','Home\orderController@add');
Route::post('home/order/insert','Home\orderController@insert');
Route::get('home/order/shouhuo/{id}','Home\orderController@shouhuo');



// 前台登录
Route::get('/home/user/login', 'Home\LoginController@login');
Route::post('/home/user/login', 'Home\LoginController@login');
Route::get('/home/user/logout', 'Home\LoginController@logout');
Route::get('/home/user/register', 'Home\RegisterController@register');
Route::post('/home/user/register', 'Home\RegisterController@register');

// 忘记密码
Route::get('/home/reset/forget', 'Home\ResetController@forget');
Route::post('/home/reset/send', 'Home\ResetController@send');
Route::get('/home/reset/find/{token}', 'Home\ResetController@find');
Route::get('/home/reset/info', 'Home\ResetController@info');
Route::post('/home/reset/uppass', 'Home\ResetController@uppass');


// 后台文章管理
Route::resource('/admin/article', 'Admin\ArticleController');
//后台文章分类管理
Route::resource('/admin/articlecategory', 'Admin\ArticleCategoryController');

// 用户个人中心
Route::get('/home/user/userinfo', 'Home\UserController@userinfo');
Route::get('/home/user/userorder', 'Home\UserController@userorder');
Route::get('/home/user/usersc', 'Home\UserController@usersc');
Route::get('/home/user/delsc/{id}', 'Home\UserController@delsc');
Route::post('/home/user/info_edit', 'Home\UserController@info_edit');
Route::post('/home/user/update', 'Home\UserController@update');
Route::get('/home/user/editpassword', 'Home\UserController@editpassword');
Route::get('/home/user/qd', 'Home\UserController@qd');
Route::get('/home/user/cj', 'Home\UserController@cj');


//文章管理
Route::resource('/admin/article', 'Admin\ArticleController');

//前台文章
Route::get('home/article/index/{id?}','Home\ArticleController@index');
Route::get('home/article/detail/{id}','Home\ArticleController@detail');

// 前台留言互动
Route::get('/home/forum/index','Home\ForumController@index');
Route::get('/home/forum/add','Home\ForumController@add');
Route::post('/home/forum/insert','Home\ForumController@insert');
Route::get('/home/forum/detail/{id}','Home\ForumController@detail');
Route::post('/home/forum/plinsert','Home\ForumController@plinsert');
Route::get('home/dianzan/add/{id}','Home\DianzanController@add');
//前台加入我们
Route::get('home/joinme/index','Home\IndexController@joinme');
